stylecontext: Only look up stuff in the cache that can be in the cache
authorBenjamin Otte <otte@redhat.com>
Sat, 13 Dec 2014 01:07:34 +0000 (02:07 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 7 Jan 2015 13:26:47 +0000 (14:26 +0100)
Only saved styles are stored in the cache so we should look only those
up there.

gtk/gtkstylecontext.c

index c27ea3daa70265d322b66e1eb7a01cc8938297a7..57e0852ecfed82a646f977685e18d14c6eeadd8c 100644 (file)
@@ -729,16 +729,15 @@ style_values_lookup (GtkStyleContext *context)
 
   g_assert (priv->widget != NULL || priv->widget_path != NULL);
 
-  values = g_hash_table_lookup (priv->style_values, info->decl);
-  if (values)
-    {
-      style_info_set_values (info, values);
-      return values;
-    }
-
-
   if (gtk_style_context_is_saved (context))
     {
+      values = g_hash_table_lookup (priv->style_values, info->decl);
+      if (values)
+        {
+          style_info_set_values (info, values);
+          return values;
+        }
+
       values = gtk_css_static_style_new ();
       g_hash_table_insert (priv->style_values,
                            gtk_css_node_declaration_ref (info->decl),